package com.boonya.spring.config;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.PropertySource;
import org.springframework.stereotype.Component;

import java.util.HashMap;
import java.util.Map;

/**
 * @ClassName: PropertiesConfig
 * @Description: TODO(功能说明 : 读取db.properties)
 * @author: pengjunlin
 * @motto: 学习需要毅力，那就秀毅力
 * @date 2021/3/28 11:32
 */
@Component
@ConfigurationProperties(prefix = "db")
@PropertySource("classpath:db.properties")
public class PropertiesConfig {

    private Map<String, String> db = new HashMap<>();

    public Map<String, String> getDb() {
        return db;
    }

    public void setDb(Map<String, String> db) {
        this.db = db;
    }
}
